﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;

namespace YTBZ.PUB
{
    public partial class ImageView : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            string strFilePath = Request.QueryString["path"];
            FileStream fs = new FileStream(strFilePath, FileMode.Open, FileAccess.Read);
            BinaryReader br = new BinaryReader(fs);
            int fileLength = (int)fs.Length;
            Byte[] fileByte = new Byte[fileLength];
            br.Read(fileByte, 0, fileLength);
            fs.Close();
            br.Close();

            Response.ContentType = "image/jpeg";//图片显示格式
            Response.BinaryWrite(fileByte);
            Response.Flush();
            Response.End();
        }
    }
}